//
//  IAuthClient.h
//  HHNMobileCore
//
//  Created by huhmf on 15/7/24.
//  Copyright (c) 2015年 huhmf. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol IAuthClient <NSObject>

@optional
/**
 *  请求登录
 *
 *  @param userName  用户名
 *  @param password  密码
 *  @param succBlock 登录成功回调
 *  @param failBlock 登录失败回调
 */
-(void)requestLoginWithUserName:(NSString *)userName password:(NSString *)password code:(NSString *)code SuccBlock:(void(^)())succBlock failBLock:(void(^)(NSString *message))failBlock;


/**
 *  退出登陆
 *
 *  @param appVersion appVersion
 *  @param platform   客户端平台
 *  @param type       异步类型
 *  @param succBlock  成功回调
 *  @param failBlock  失败回答
 */
-(void) requestLogoutWithAppVersion:(NSString *) appVersion andPlatform:(NSString *) platform andType:(NSString *)type SuccBlock:(void(^)())succBlock failBlock:(void(^)(NSString *msg)) failBlock;
/**
 *  登录成功的通知，包括断线重练成功
 *
 *  @param userId 用户uid
 */
- (void)onLoginSucceed:(long long)userId;


/**
 *  app初始化
 *
 *  @param successBlock 成功回调
 *  @param failBlock    失败回调
 */
- (void) appInitWithSuccessBlock:(void(^)()) successBlock andFailBlock:(void(^)(NSString *msg)) failBlock;

/**
 *  app心调
 *
 *  @param successBlock 成功回调
 *  @param failBlock    失败回调
 */
-(void) appheartBeatSuccessBlock:(void(^)(BOOL isLogin)) successBlock andFailBlock:(void(^)(NSString *msg)) failBlock;


/**
 *  第三方登录
 *
 *  @param openId       openId
 *  @param successBlock 成功登录
 *  @param failBlock    失败登录或者授权
 */
-(void) requestPartyLoginWith:(NSString *) openId andType:(NSString*) type andSuccessBlock:(void(^)(BOOL isLogin)) successBlock andFailBlock:(void(^)(NSString *msg)) failBlock;

@end
